package com.yuyou.fn.tradingservice.service;

import com.github.wens.framework.service.ISuperService;
import com.github.wens.mybatisplus.plugins.Page;
import com.yuyou.fn.platform.entity.SysUser;
import com.yuyou.fn.tradingservice.entity.PersonLeaseMessage;
import com.yuyou.fn.tradingservice.entity.ServiceOrder;
import com.yuyou.fn.tradingservice.vo.ServiceOrderItemVo;
import com.yuyou.fn.tradingservice.vo.ServiceOrderVo;
import com.yuyou.fn.tradingservice.vo.ServiceProductOrderVo;

import java.math.BigDecimal;
import java.util.List;

/**
 *
 * ServiceOrder 表数据服务层接口
 *
 */
public interface IServiceOrderService extends ISuperService<ServiceOrder,Long> {


    void payServiceOrder(Long orderId, BigDecimal paidAmount,Integer payWay);

    void changePayableAmount(Long orderId,BigDecimal paidAmount);

    ServiceOrder createOrder(Long addressId, SysUser user, List<Long> listingIds,Long payMainAccountId);

    ServiceOrder createGoodsOrderByBuyImmediately(SysUser sysUser,Long productId,Integer quantity,Long payMainAccountId,Long addressId);

    ServiceOrder createLeaseOrderByBuyImmediately(List<PersonLeaseMessage> personLeaseMessageList,SysUser sysUser,Long productId,Long payMainAccountId,Long addressId);



    Page<ServiceOrder> findOrderForPage(ServiceOrderVo orderVo, int pageNo, int pageSize);








/*
    ServiceOrder generateLeaseOrder(SysUser user, ServiceProduct product,List<PersonLeaseMessage> personLeaseMessageList);

    ServiceOrder generateLeaseOrder(SysUser user, Long[] cartItemIds);

*/



    Page<ServiceProductOrderVo> findPageOrderList(ServiceOrderVo serviceOrderVo,int pageNo,int pageSize);

    Page<ServiceOrder> findOrderPage(Integer type, Long userId,int pageNo,int pageSize);

    ServiceProductOrderVo findPageOrderDetail(Long orderId);

    void changOrderStatus(Long orderId,Integer status);

    void confirmPayOrder(Long orderId);

    void cancelOrder(Long orderId);

    void refundOrder(Long orderId);

    void confirmOrder(Long orderId);

    void payOrder(Long orderId, Integer payWay);

    Page<ServiceOrderItemVo> findPageOrderSellList(ServiceOrderItemVo serviceOrderItemVo, int pageNo, int pageSize);


    Long countOrderNumByUserId(Long userId);



    void changeOrderStatus(Long orderId,Integer status);

}